|
|
|
|
|
|
|
Figure 12.12
The sample project uses TabStrip and TreeView controls. |
|
|
|
|
CAUTION
|
|
|
|
|
The TabStrip control is not a container. This means that controls placed in a TabStrip control do not assume the Visible, Enabled, and relative Top and Left properties of the TabStrip, as they would if you were to draw a control into a selected Frame control. Thus, clicking a TabStrip brings it to the front, covering other controls that are before it. |
|
|
|
|
|
|
|
|
To manipulate how controls appear in relation to a TabStrip, pay particular attention to the ZOrder method of the TabStrip and the affected controls. While you're working in design mode, you may need to right-click the TabStrip control and choose Send to Back. |
|
|
|
|
|
|
|
|
|
|
The next step in creating the project is to create the tabs in the TabStrip. Because you need to show two leagues, you need two tabs in the TabStrip. To set up the TabStrip control, follow these steps: |
|
|
|
|
|
|
|
|
1. Start by right-clicking tsMain to bring up the TabStrip context menu. |
|
|
|
|
|
|
|
|
2. Click the Properties menu item at the bottom of the context menu to display the Property Pages dialog box for tsMain. |
|
|
|
|
|
|
|
|
3. Click the Tabs tab, and type American League in the Caption field (see Figure 12.13). |
|
|
|
|
|
|
|
|
4. Click the Insert Tab button to add a tab. |
|
|
|
|
|
|
|
|
5. In the Caption field, type National League. |
|
|
|
|
|
|
|
|
6. Click OK. The captions then appear in the TabStrip control. |
|
|
|
|
|
|
|
|
Setting Up the TreeView Control |
|
|
|
|
|
|
|
|
As was the case in the ListView project, you will set up the TreeView control by adding objects to a collection with code. You use the TreeView control to display a hierarchical organization of a selected baseball league. Each league has three divisions: East, West, and Central. The divisions have five, five, and four teams, respectively. |
|
|
|
|
|